package com.haoze.nurseapp.dao;

import com.haoze.common.mapper.MyMapper;
import com.haoze.nurseapp.model.DrugRationalUse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zh
 * @version 1.0
 * @date 2020/6/3 16:29
 * @email 690378361@163.com
 */
public interface DrugRationalUseMapper extends MyMapper<DrugRationalUse> {
    void updateOrInsertEntity(DrugRationalUse drugRationalUse);

    DrugRationalUse selectByRowId(String rowId);

    /**
     * 查询记录
     * @param inpatorderdataIds
     * @param type  0-未提交审批，1-存在未审批(或审批不通过)
     * @return
     */
    List<DrugRationalUse> selectByInpatorderdataIds(@Param("inpatorderdataIds") List<String> inpatorderdataIds, @Param("type") String type);

    /**
     * 医嘱
     * 查询不包含ctrlName的合理用药记录
     * @param orderId
     * @param ctrlName
     * @return
     */
    List<DrugRationalUse> selectByParams(@Param("orderId") String orderId, @Param("ctrlName") String ctrlName);

    /**
     * 处方.
     * 查询不包含ctrlName的合理用药记录
     * @param orderId
     * @param ctrlName
     * @return
     */
    List<DrugRationalUse> selectPrescByParams(@Param("orderId") String orderId, @Param("ctrlName") String ctrlName);
}
